function sendNotification(obj, callback){
	//countId必须为字符串，不能为数字
	let countId = Math.random() + ''
	chrome.notifications.create(countId, obj, callback);
	clearNotification(countId, 3)
}
function clearNotification(id, time){
	setTimeout(() => {
		chrome.notifications.clear(id);
	}, time * 1000)
}

chrome.runtime.onMessage.addListener((message,sender,callback) => {
	if(message === "getStorage"){
		chrome.storage.sync.get(["status"], res => {
			console.log(res)
			callback(res)
		})
	}else if (message === "finished"){
		sendNotification({//需要申请权限notifications，只能在后台中使用
			type:"basic",
			title:"智慧树视频看完了",
			message:"请手动跳转下一个视频",
			iconUrl:icoPath
		}, () => {})
	}
})